<% content_for :title do %>Edit an existing product<% end %><h1>Editing Product</h1>

<% if @product.errors.any? %>
	<div class="error_explaination">
		<h2><%= pluralize(@product.errors.count, "error") %> prohibited this product from being updated:</h2>

		<ul>
		<% @product.errors.full_messages.each do |msg| %>
			<li><%= msg %></li>
		<% end %>
		</ul>
	</div>
<% end %>

<form action="<%= product_path %>" method="post">
	<input name="authenticity_token" value="<%= form_authenticity_token %>" type="hidden">
	<input name="_method" value="patch" type="hidden" />
	<input type="text" name="product[name]" value="<%= @product.name %>" />
	<input type="text" name="product[description]" value="<%= @product.description %>" />
	<input type="text" name="product[pricing]" value="<%= @product.pricing %>" />
	<input type="submit" value="Update Product" />
</form>

<%= link_to 'Cancel', products_path %>